<!--
	作者：956911785@qq.com
	时间：2019年8月15日14:05:03
	描述：学生原创-查看
-->

<template>
	<Modal title="查看学生原创作品" v-model="modal0" width="1000px">
		<Form ref="params"  :label-width="120" label-position="left">
			<div style="width:100%;height:480px; overflow-y: hidden;">
		     
				<div style="width:100%;height: 60px;line-height: 60px;float:left;">
		        	<div style="width: 50%;text-align: left;float: left;" align="left">
				        <FormItem  label="姓名">
				        	<label>{{params.sname}}</label>
		        		</FormItem>
		        	</div>
		        	<div style="width: 50%;text-align: left;float: left;" align="left">
				         <FormItem  label="年级">
				        	<label>{{params.nj}}</label>
		        		</FormItem>
		        	</div>
		      	</div>
		      	
		      	<div style="width:100%;height: 60px;line-height: 60px;float:left;">
		        	<div style="width: 50%;text-align: left;float: left;" align="left">
				        <FormItem  label="班级">
				        	<label>{{params.bj}}</label>
		        		</FormItem>
		        	</div>
		        	<div style="width: 50%;text-align: left;float: left;" align="left">
				        <FormItem  label="作品名称">
				        	<label>{{params.zpmc}}</label>
		        		</FormItem>
		        	</div>
		      	</div>

		      	<div style="width:100%;float:left;text-align: left;">
			        <FormItem label="作品内容">
			        	<p>{{params.content}}</p>
	        		</FormItem>
		      	</div>
		      	
		      	<div style="width:100%;float:left;text-align: left;">
			        <FormItem label="作品内容(图片格式)">
			        	<template v-for="item in photos">
			        		<div style="width:100px;float:left;padding-right: 10px;">
			        			<img :src="item" style="width:100%;height: auto;" @click.native="handleView(item)">
			        		</div>
			        	</template>
	        		</FormItem>
		        </div>
   				<Modal title="View Image" v-model="visible">
			        <img :src="imgurl" v-if="visible" style="width: 100%" >
			    </Modal>
		   </div> 
	    </Form>
	   	<div slot="footer">
	    	<Button type="text"  @click="closeModal()">取消</Button>
	    	<Button type="primary" @click="addsave()" >确定</Button>
	    </div>
    </Modal>
</template>

<script>

	const _config = require('./../../../../../config/config')
	export default {
		name:"tconent",
		props: {
    		params:{
    			type:Object,	
    			default: function() {
					return null
				}
    		},
    	},
		data() {
			return { 
                modal0:false,

				imgurl: '',
                visible: false,
                photos: [],
			}
		},
		methods: {
            closeModal(){
	      	    this.modal0 = false;
	        },
	      
	        handleView (item) {
	        	this.imgurl=item;
                this.visible = true;
            },
          
		},
		mounted() {
		},
		watch:{
			modal0(news,olds){
				if(news){
					var photos=this.params.photos;
					console.log(this.params);
					var ps=[];
					for(var i=0;i<photos.length;i++){
						ps.push(_config._ADMIN_SERVER+"/readbook/"+photos[i].PICURL);
					}
					this.photos=ps;
				}
			}
		},
		computed: {
		}	
	}
</script>

<style scoped="scoped">
	
</style>



